import 'package:cream_chat_flutter/pages/UserDetails/UserDetailsProvider.dart';
import 'package:cream_chat_flutter/globals/ThemeProvider.dart';
import 'package:provider/provider.dart';
import 'package:flutter/material.dart';

///用户详情页面，路由页，需要继承Page
class UserDetails extends Page {
  const UserDetails({
    LocalKey key,
    String name,
  }) : super(key: key, name: name);

  Route createRoute(BuildContext context) => MaterialPageRoute(
    settings: this,
    builder: (BuildContext context) => ChangeNotifierProvider(
        create: (context) => UserDetailsProvider(), child: _UserDetails()),
  );
}

class _UserDetails extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _UserDetailsState();
}

class _UserDetailsState extends State<_UserDetails> {
  @override
  Widget build(BuildContext context) {
    return Consumer2(
        builder: (BuildContext context, ThemeProvider tp, UserDetailsProvider mp,
            Widget child) =>
            Scaffold(
              appBar: AppBar(title: tp.Title("用户详情")),
              body: Text("用户详情"),
            ));
  }
}